Add expression_types(), pattern_types(), binding_types() to DefWithBody#21584
Open
regexident wants to merge 1 commit intorust-lang:masterfrom
Open
Add expression_types(), pattern_types(), binding_types() to DefWithBody#21584regexident wants to merge 1 commit intorust-lang:masterfrom
expression_types(), pattern_types(), binding_types() to DefWithBody#21584regexident wants to merge 1 commit intorust-lang:masterfrom
Conversation
be51e87 to
ff7b19e
Compare
ChayimFriedman2
requested changes
Feb 5, 2026
Contributor
ChayimFriedman2
left a comment
There was a problem hiding this comment.
hir_ty::Ty should be workable fine outside ra_ap, but you need to import the next-solver.
|
|
||
| /// Returns an iterator over the inferred types of all expressions in this body. | ||
| /// | ||
| /// Returns `None` for builtin derive impl methods which don't have inference data. |
Contributor
There was a problem hiding this comment.
I don't like calling out builtin derive impls like that. Instead we should just return an empty iterator for them (they behave as if they have no body).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR builds upon #20683, adding corresponding high-level methods, returning
hir::Type<'db>, as opposedhir_ty::Ty<'db>, since the latter are unfortunately sort of unusable from outside ofra_ap.Context:
cargo-moduleshas been stuck atra_ap@ 0.0.289 for quite a while now, due to the regression that #20683 was meant to fix (and due to a lack of time on my part), but that PR turned out to be insufficient, hence this PR with follow-up changes.cc @ChayimFriedman2, since you reviewed the related PR already.